<template>
	<view class="bg">
		<view class="task_bg">
			<view class="task_one">
				<view class="task_left_top">
					<view class="task_round">
						<image src="../../../static/images/common/task.png" mode=""></image>
					</view>
					<view class="name">{{ taskArr.name }}</view>
				</view>
				<view class="task_content">
					<view class="task_name">
						<view class="task_left">任务名称</view>
						<view class="task_right nameFont">{{ taskArr.rwmc }}</view>
					</view>
					<view class="task_child">
						<view class="task_test">
							<view class="task_left">子事项</view>
							<view class="task_right childFont">{{ taskArr.zsx }}</view>
						</view>
						<view class="task_test">
							<view class="task_left">反馈内容</view>
							<view class="task_right childFont">{{ taskArr.fknr }}</view>
						</view>
						<view class="task_test">
							<view class="task_left">牵头单位</view>
							<view class="task_right childFont">{{ taskArr.qtdw }}</view>
						</view>
						<view class="task_test">
							<view class="task_left">协办单位</view>
							<view class="task_right childFont">{{ taskArr.xbdw }}</view>
						</view>
						<view class="task_test">
							<view class="task_left">任务轮次</view>
							<view class="task_right childFont">{{ taskArr.rwlc }}</view>
						</view>
						<view class="task_test">
							<view class="task_left">任务时限</view>
							<view class="task_right childFont">{{ taskArr.rwsx }}</view>
						</view>
						<view class="task_test">
							<view class="task_left">牵头单位</view>
							<view class="task_right childFont">{{ taskArr.qtdw }}</view>
						</view>
						<view class="task_test">
							<view class="task_left">协办单位</view>
							<view class="task_right childFont">{{ taskArr.xbdw }}</view>
						</view>
						<view class="task_test">
							<view class="task_left">任务轮次</view>
							<view class="task_right childFont">{{ taskArr.rwlc }}</view>
						</view>
						<view class="task_test">
							<view class="task_left">任务时限</view>
							<view class="task_right childFont">{{ taskArr.rwsx }}</view>
						</view>
						<!-- 流程选择 -->
						<view class="task_test" v-if="type == '流程选择'">
							<view class="task_left">流程选择</view>
							<view class="task_right liucheng" @tap="showLcxz = true">{{
                lcxz
              }}</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	<!-- 	1 征地拆迁
		<u-button v-if="type == '征地拆迁'" type="primary" size="default" class="customStyle" :ripple="true"
			@tap="toBsjz()">报送进展</u-button>
		<!-- 2 提请协调 -->
		<view class="tqxt_buttons" v-if="type == '提请协调'">
			<view @tap="showTqxt = true">退回</view>
			<view @tap="toTqxt()">办结</view>
		</view>
		<u-modal v-model="showTqxt" :content="modelContent" @confirm="confirmModel" @cancel="showTqxt = false"
			:show-cancel-button="true"></u-modal>

		<!-- 3 流程选择 -->
		<u-picker v-model="showLcxz" mode="selector" :default-selector="[0]" :range="selectorObj" range-key="cateName"
			@confirm="confirmPicker"></u-picker>
		<!-- 4 项目进展 -->
		<view class="xmjz_buttons" v-if="type == '项目进展'">
			<view>提请协调</view>
			<view>发起中断</view>
			<view @tap="toXmjz()">报送进展</view>
		</view>
		<!-- 5 回退申请 -->
		<view class="htsq_buttons" v-if="type == '回退申请'"> 审核通过 </view>
		<!-- 6 督查任务 -->
		<view class="dcfk_buttons" v-if="type == '督查任务'" @tap="toDcfk()">
			督查反馈
		</view>
		<!-- 7 项目流程 -->
		<view class="xmlc_buttons" v-if="type == '项目流程'">
			<view @tap="toXmlc('/pages/zdxm/details/xmlc/tqxt')">提请协调</view>
			<view @tap="toXmlc('/pages/zdxm/details/xmlc/jdht')">节点回退</view>
			<view>完成</view>
		</view> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				taskArr: {
					name: "征地拆迁",
					rwmc: "2021重大项目测试任务清单",
					zsx: "推广生态调控、农艺改良、物理防控、生物防治等措施，2020年实现不用化学农药绿色生态茶园1.8万亩。",
					fknr: "测试内容，子任务测试反馈内容20200217，测试通过！",
					zt: "待签收",
					ztType: 1,
					qtdw: "农业局",
					xbdw: "住建局、商务局、统计局",
					rwlc: "第 3 轮",
					rwsx: "2021-01-18",
				},
				type: "",
				showTqxt: false,
				modelContent: "是否确认退回提请协调？",
				lcxz: "点击选择",
				showLcxz: false,
				selectorObj: [{
						cateName: "多规合一会商",
						id: 0,
					},
					{
						cateName: "重新编制规划（否）",
						id: 0,
					},
					{
						cateName: "用途管制预检（是）",
						id: 0,
					},
				],
			};
		},
		onLoad(option) {
			console.log(JSON.parse(option.item))
			this.taskArr = JSON.parse(option.item)
			// this.type = option.type;
		},
		methods: {
			plane() {
				this.show = true;
			},
			// 征地拆迁
			toBsjz() {
				uni.navigateTo({
					url: "/pages/zdxm/details/zdcq/index",
				});
			},
			// 提请协调
			// 办结页面
			toTqxt() {
				uni.navigateTo({
					url: "/pages/zdxm/details/tqxt/index",
				});
			},
			// 项目进展
			toXmjz() {
				uni.navigateTo({
					url: "/pages/zdxm/details/xmjz/index",
				});
			},
			// 督查反馈
			toDcfk() {
				uni.navigateTo({
					url: "/pages/zdxm/details/dcfk/index",
				});
			},
			toXmlc(page) {
				uni.navigateTo({
					url: page,
				});
			},
			// 退回
			confirmModel() {},
			// 流程选择
			confirmPicker(e) {
				this.lcxz = this.selectorObj[e].cateName;
			},
		},
	};
</script>

<style lang="scss" scoped>
	.top_search {
		width: 100vw;
		height: 120rpx;
		background-color: #3988ff;
		display: flex;
		align-items: center;
		padding: 0 20rpx;
		position: fixed;
		top: 0;
		left: 0;
		z-index: 10;

		.search_screening {
			margin-left: 2%;
			height: 100%;
			display: flex;
			align-items: center;
			justify-content: center;

			image {
				width: 32rpx;
				height: 32rpx;
				margin-right: 10rpx;
			}

			.font {
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: rgba(255, 255, 255, 0.7);
			}
		}
	}

	.customStyle {
		margin-top: -20rpx;
	}

	.task_bg {
		// margin-top: 120rpx;

		.task_one {
			background-color: rgba(255, 255, 255, 1);
			padding: 24rpx;
			position: relative;
			margin-bottom: 40rpx;
			box-shadow: 0px 0px 24rpx 0px rgba(48, 116, 255, 0.1);
			border-radius: 24rpx 8rpx 8rpx 8rpx;

			.line {
				width: 1rpx;
				height: calc(100% - 48rpx);
				// background-color: pink;
				position: absolute;
				left: 44rpx;
				top: 24rpx;
				border-left: 1rpx dashed rgba(48, 116, 255, 0.1);
				// z-index: 5;
			}
		}

		.record_flex {
			display: flex;
			align-items: flex-start;
			margin-bottom: 40rpx;

			.record_flex_1 {
				flex: 1;
				padding-left: 25rpx;

				.record_top {
					display: flex;
					align-items: center;
					justify-content: space-between;
					margin-bottom: 10rpx;

					.flex_1 {
						flex: 1;
						display: flex;
						align-items: center;
						justify-content: space-between;

						image {
							width: 16rpx;
							height: 14rpx;
						}
					}

					.flex_2 {
						flex: 1.5;
						display: flex;
						align-items: center;
						justify-content: space-between;

						image {
							width: 16rpx;
							height: 14rpx;
						}
					}

					.flex_right {
						display: flex;
						justify-content: flex-end;
						flex: 1;
					}

					.center_font {
						font-size: 24rpx;
						font-family: PingFang SC;
						font-weight: 400;
						color: #3074ff;
					}

					.name_font {
						font-size: 28rpx;
						font-family: PingFang SC;
						font-weight: bold;
						color: #272b32;
					}
				}

				.time {
					font-size: 20rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #8e9cb3;
				}
			}

			.record_flex_40 {
				width: 40rpx;

				.round {
					width: 40rpx;
					height: 40rpx;
					background: linear-gradient(-30deg, #3074ff 0%, #41baff 100%);
					box-shadow: 2rpx 3rpx 12rpx 0rpx rgba(48, 116, 255, 0.4);
					border-radius: 50%;
					display: flex;
					align-items: center;
					justify-content: center;
					z-index: 999999;

					image {
						width: 16rpx;
						height: 16rpx;
					}
				}
			}
		}

		.task_left_top {
			position: absolute;
			top: 0;
			left: 0;
			min-width: 200rpx;
			height: 48rpx;
			background: rgba(48, 116, 255, 0.2);
			border-radius: 24rpx;
			display: flex;
			align-items: center;

			.name {
				font-size: 20rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #3074ff;
				padding: 0 20rpx;
			}

			.task_round {
				width: 48rpx;
				height: 48rpx;
				background: #3074ff;
				z-index: 5;
				box-shadow: 2px 3px 12px 0px rgba(48, 116, 255, 0.4);
				border-radius: 50%;
				display: flex;
				align-items: center;
				justify-content: center;

				image {
					width: 24rpx;
					height: 24rpx;
				}
			}
		}

		.task_content {
			width: 100%;
			margin-top: 40rpx;

			.task_btnArr {
				display: flex;
				align-items: center;
				justify-content: flex-end;
				margin-top: 40rpx;
			}

			.task_btn {
				background: #3074ff;
				border-radius: 4rpx;
				padding: 8rpx 16rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				margin-left: 20rpx;

				image {
					width: 24rpx;
					height: 24rpx;
					margin-right: 10rpx;
				}

				.more {
					width: 24rpx;
					height: 6rpx;
					margin-right: 10rpx;
				}

				.font {
					font-size: 24rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: rgba(255, 255, 255, 0.7);
				}
			}

			.btn_color1 {
				background-color: rgba(231, 233, 240, 1);
			}

			.btn_color2 {
				background-color: rgba(248, 95, 120, 1);
			}

			.task_name {
				display: flex;
				padding-bottom: 40rpx;
			}

			.task_child {
				padding: 20rpx 0;
				border-top: 1rpx solid rgba(231, 233, 240, 1);
				border-bottom: 1rpx solid rgba(231, 233, 240, 1);
			}

			.task_test {
				display: flex;
				margin: 20rpx 0;
			}

			.task_left {
				flex: 2;
				font-size: 24rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #8e9cb3;
			}

			.nameFont {
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #272b32;
			}

			.task_right {
				flex: 7;
				display: flex;
				align-items: center;

				.childFont {
					font-size: 28rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #272b32;
				}

				.zt_type1 {
					margin-left: 10rpx;
					background: #f85f78;
					border-radius: 4rpx;
					font-size: 20rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: rgba(255, 255, 255, 0.7);
					padding: 0 16rpx;
					display: flex;
					align-items: center;
					justify-content: center;
				}

				.zt_type2 {
					margin-left: 10rpx;
					background: rgba(250, 173, 51, 1);
					border-radius: 4rpx;
					font-size: 20rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: rgba(255, 255, 255, 0.7);
					padding: 0 16rpx;
					display: flex;
					align-items: center;
					justify-content: center;
				}
			}
		}
	}

	.liucheng {
		font-size: 28rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #cdd3e0;
	}

	.tqxt_buttons {
		width: 100%;
		height: 98rpx;
		line-height: 98rpx;
		text-align: center;
		display: flex;
		flex-flow: row nowrap;
		justify-content: flex-start;
		align-content: center;
		position: fixed;
		bottom: 0;
		left: 0;

		view:nth-child(1) {
			flex: 1;
			background: #ffffff;
			border: 1rpx solid #e7e9f0;
			font-size: 36rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #8e9cb3;
		}

		view:nth-child(2) {
			flex: 1;
			background: #3074ff;
			font-size: 36rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #fefefe;
		}
	}

	.xmjz_buttons,
	.xmlc_buttons {
		width: 100%;
		text-align: center;
		position: fixed;
		bottom: 20rpx;
		left: 0;
		display: flex;
		flex-flow: column wrap;
		align-items: center;

		view:nth-child(1),
		view:nth-child(2) {
			width: 710rpx;
			height: 98rpx;
			line-height: 98rpx;
			border: 1rpx solid #3074ff;
			border-radius: 49rpx;
			font-size: 36rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #3074ff;
		}

		view:nth-child(2) {
			margin-top: 30rpx;
		}

		view:nth-child(3) {
			margin-top: 30rpx;
			width: 710rpx;
			height: 98rpx;
			line-height: 98rpx;
			background: #3074ff;
			border-radius: 49rpx;
			font-size: 36rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #fefefe;
		}
	}

	.htsq_buttons,
	.dcfk_buttons {
		width: 750rpx;
		height: 98rpx;
		line-height: 98rpx;
		background: #3074ff;
		font-size: 36rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #fefefe;
		position: fixed;
		bottom: 0;
		left: 0;
		text-align: center;
	}
</style>
